import hotkeys, { KeyHandler } from 'hotkeys-js'

export default function useHotKey(keys: string, callback: KeyHandler) {
  onMounted(() => {
    hotkeys(keys, callback)
  })

  onUnmounted(() => {
    hotkeys.unbind(keys, callback)
  })
}
